package vip.xumy.admin.sys.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import vip.xumy.admin.sys.pojo.Dictionary;
import vip.xumy.admin.sys.service.DictionaryService;

/**
 * @author:mengyxu
 * @date:2019年10月21日
 */
@RestController
@RequestMapping("public")
public class SysPublicContoller {
	@Value("${version.num:3.0.0}")
	private String versionNum;

	@Autowired
	private DictionaryService dictService;

	@RequestMapping(value = "get/dict", method = RequestMethod.POST)
	public Map<String, List<Dictionary>> getDictionarys(@RequestBody String[] codes) {
		return dictService.getDicts(codes);
	}

	@RequestMapping(value = "version")
	public String getVersionNum() {
		return versionNum;
	}

}
